
	function setControlValue(id,value){
		$("#"+id+"").val(value);
	}
	
	function comShowMsg(msg){
		layer.msg(msg);
	}

	//---------------------------------------------------  
	// 日期格式化  
	// 格式 YYYY/yyyy/YY/yy 表示年份  
	// MM/M 月份  
	// W/w 星期  
	// dd/DD/d/D 日期  
	// hh/HH/h/H 时间  
	// mm/m 分钟  
	// ss/SS/s/S 秒  
	//---------------------------------------------------  
	Date.prototype.Format = function(formatStr)   
	{   
	    var str = formatStr;   
	    var Week = ['日','一','二','三','四','五','六'];  
	  
	    str=str.replace(/yyyy|YYYY/,this.getFullYear());   
	    str=str.replace(/yy|YY/,(this.getYear() % 100)>9?(this.getYear() % 100).toString():'0' + (this.getYear() % 100));   
	  
	  	var myMonth = parseInt(this.getMonth())+1;
	  	 
	    str=str.replace(/MM/,myMonth>9?myMonth.toString():'0' + myMonth);   
	    str=str.replace(/M/g,myMonth);   
	  
	    str=str.replace(/w|W/g,Week[this.getDay()]);   
	  
	    str=str.replace(/dd|DD/,this.getDate()>9?this.getDate().toString():'0' + this.getDate());   
	    str=str.replace(/d|D/g,this.getDate());   
	  
	    str=str.replace(/hh|HH/,this.getHours()>9?this.getHours().toString():'0' + this.getHours());   
	    str=str.replace(/h|H/g,this.getHours());   
	    str=str.replace(/mm/,this.getMinutes()>9?this.getMinutes().toString():'0' + this.getMinutes());   
	    str=str.replace(/m/g,this.getMinutes());   
	  
	    str=str.replace(/ss|SS/,this.getSeconds()>9?this.getSeconds().toString():'0' + this.getSeconds());   
	    str=str.replace(/s|S/g,this.getSeconds());   
	  
	    return str;   
	}   


	function strToDate(fDate){
		
		 var fullDate = fDate.split("-");  
     
    	 return new Date(fullDate[0], fullDate[1]-1, fullDate[2], 0, 0, 0); 
	}

	function isIP(ip)
	{
		var reSpaceCheck = /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/;
		if (reSpaceCheck.test(ip))
		{
			ip.match(reSpaceCheck);
			if (RegExp.$1<=255&&RegExp.$1>=0
			  &&RegExp.$2<=255&&RegExp.$2>=0
			  &&RegExp.$3<=255&&RegExp.$3>=0
			  &&RegExp.$4<=255&&RegExp.$4>=0)
			{
				return true; 
			}else
			{
				return false;
			}
		}else
		{
			return false;
		}
	}
	function isIP2(ip) 
	{ 
		var re =  /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/ 
		return re.test(ip); 
	}
	

	function isURL(str){
    	//return !!str.match(/(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/g);
  		return /^([\w-]+\.)+((com)|(net)|(org)|(gov\.cn)|(info)|(cc)|(com\.cn)|(net\.cn)|(org\.cn)|(name)|(biz)|(tv)|(cn)|(mobi)|(name)|(sh)|(ac)|(io)|(tw)|(com\.tw)|(hk)|(com\.hk)|(ws)|(travel)|(us)|(tm)|(la)|(me\.uk)|(org\.uk)|(ltd\.uk)|(plc\.uk)|(in)|(eu)|(it)|(jp))$/.test(str);
	}
	

	function isnum(str){
		return /^[0-9]*$/.test(str);
	}
